CREATE SCHEMA [SLAM]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Faq](
	[ContentItemId] [varchar](25) NOT NULL,
	[Question] [varchar](255) NOT NULL,
	[Answer] [varchar](max) NOT NULL,
	[ThumbnailImageUrl] [varchar](2000) NULL,
 CONSTRAINT [PK_Faq] PRIMARY KEY CLUSTERED 
(
	[ContentItemId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [SLAM].[EventLog](
	[EventLogID] [int] IDENTITY(1,1) NOT NULL,
	[EventDate] [datetime] NULL,
	[EventName] [varchar](1000) NULL,
	[TypeName] [varchar](200) NULL,
	[Message] [varchar](max) NULL,
 CONSTRAINT [PK_SLAM_EventLog] PRIMARY KEY CLUSTERED 
(
	[EventLogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Event](
	[ContentItemId] [varchar](25) NOT NULL,
	[Title] [varchar](255) NOT NULL,
	[StartDate] [datetime] NOT NULL,
	[EndDate] [datetime] NOT NULL,
	[Description] [varchar](max) NULL,
	[PageContent] [varchar](max) NULL,
	[ThumbnailImageUrl] [varchar](2000) NULL,
	[Location] [varchar](max) NULL,
	[EventType] [int] NULL,
	[AllDayEvent] [bit] NULL,
	[Recurrence] [bit] NULL,
	[RecurrenceData] [varchar](max) NULL,
	[RecurrenceID] [varchar](255) NULL,
	[MasterSeriesItemID] [int] NULL,
 CONSTRAINT [PK_Event] PRIMARY KEY CLUSTERED 
(
	[ContentItemId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Download](
	[ContentItemId] [varchar](25) NOT NULL,
	[Title] [varchar](255) NOT NULL,
	[Name] [varchar](255) NOT NULL,
	[Url] [varchar](2000) NOT NULL,
	[Description] [varchar](max) NULL,
	[PageContent] [varchar](max) NULL,
	[ThumbnailImageUrl] [varchar](2000) NULL,
 CONSTRAINT [PK_Download] PRIMARY KEY CLUSTERED 
(
	[ContentItemId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[BrokenLink](
	[BrokenLinkId] [int] IDENTITY(1,1) NOT NULL,
	[Url] [varchar](2000) NOT NULL,
	[Application] [varchar](200) NOT NULL,
	[ModifiedDate] [datetime] NULL,
	[IsHandled] [bit] NOT NULL,
	[Message] [varchar](max) NULL,
	[RedirectUrl] [varchar](2000) NULL,
	[RedirectApplication] [varchar](200) NULL,
	[Referrer] [varchar](max) NULL,
	[IgnoreOneTime] [bit] NOT NULL,
 CONSTRAINT [PK_BrokenLink] PRIMARY KEY CLUSTERED 
(
	[BrokenLinkId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Article](
	[ContentItemId] [varchar](25) NOT NULL,
	[Title] [varchar](255) NOT NULL,
	[Description] [varchar](max) NULL,
	[PageContent] [varchar](max) NULL,
	[ThumbnailImageUrl] [varchar](2000) NULL,
 CONSTRAINT [PK_Article] PRIMARY KEY CLUSTERED 
(
	[ContentItemId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [SLAM].[MessageLog](
	[MessageLogID] [int] IDENTITY(1,1) NOT NULL,
	[MessageDate] [datetime] NULL,
	[MessageType] [varchar](1000) NULL,
	[Message] [varchar](max) NULL,
 CONSTRAINT [PK_SLAM_MessageLog] PRIMARY KEY CLUSTERED 
(
	[MessageLogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[CommentStatus](
	[CommentStatusID] [varchar](25) NOT NULL,
	[Name] [varchar](255) NOT NULL,
 CONSTRAINT [PK_CommentStatus] PRIMARY KEY CLUSTERED 
(
	[CommentStatusID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[User](
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [varchar](255) NOT NULL,
	[Name] [varchar](255) NOT NULL,
	[Email] [varchar](255) NULL,
	[Language] [varchar](40) NULL,
	[MembershipID] [uniqueidentifier] NULL,
 CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TrackVisit](
	[TrackVisitID] [uniqueidentifier] NOT NULL,
	[UserID] [int] NULL,
	[CreatedDate] [datetime] NOT NULL,
	[Referrer] [varchar](max) NULL,
 CONSTRAINT [PK_TrackVisit] PRIMARY KEY CLUSTERED 
(
	[TrackVisitID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TrackTagHit](
	[TrackTagHitID] [uniqueidentifier] NOT NULL,
	[TrackVisitID] [uniqueidentifier] NOT NULL,
	[TagID] [varchar](25) NOT NULL,
	[Date] [datetime] NOT NULL,
 CONSTRAINT [PK_TrackTagHit] PRIMARY KEY NONCLUSTERED 
(
	[TrackTagHitID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TrackPage](
	[TrackPageID] [uniqueidentifier] NOT NULL,
	[TrackVisitID] [uniqueidentifier] NOT NULL,
	[What] [nvarchar](1000) NOT NULL,
	[Date] [datetime] NOT NULL,
	[Referrer] [nvarchar](1000) NULL,
	[How] [nvarchar](1000) NULL,
	[PrimaryContentItemId] [varchar](25) NULL,
	[ContentItemId] [varchar](25) NULL,
 CONSTRAINT [PK_TrackPage] PRIMARY KEY NONCLUSTERED 
(
	[TrackPageID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TagCategoryCulture](
	[TagCategoryId] [varchar](25) NOT NULL,
	[Culture] [varchar](10) NOT NULL,
	[Title] [varchar](255) NOT NULL,
 CONSTRAINT [PK_TagCategoryCulture] PRIMARY KEY CLUSTERED 
(
	[TagCategoryId] ASC,
	[Culture] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Group](
	[GroupID] [int] IDENTITY(1,1) NOT NULL,
	[SiteCollectionGroupID] [int] NOT NULL,
	[Name] [varchar](255) NOT NULL,
	[View] [bit] NOT NULL,
	[Add] [bit] NOT NULL,
	[Edit] [bit] NOT NULL,
	[Approve] [bit] NOT NULL,
	[Delete] [bit] NOT NULL,
 CONSTRAINT [PK_Group] PRIMARY KEY CLUSTERED 
(
	[GroupID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [SLAM].[SiteCollection](
	[SiteCollectionID] [uniqueidentifier] NOT NULL,
	[ServerRelativeUrl] [varchar](260) NOT NULL,
 CONSTRAINT [PK_SLAM_SiteCollection] PRIMARY KEY CLUSTERED 
(
	[SiteCollectionID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Status](
	[StatusID] [int] NOT NULL,
	[Name] [varchar](255) NOT NULL,
 CONSTRAINT [PK_Status] PRIMARY KEY CLUSTERED 
(
	[StatusID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserGroup](
	[UserID] [int] NOT NULL,
	[GroupID] [int] NOT NULL,
 CONSTRAINT [PK_UserGroup] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC,
	[GroupID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [SLAM].[Site](
	[SiteID] [uniqueidentifier] NOT NULL,
	[Name] [varchar](260) NOT NULL,
	[Title] [varchar](260) NOT NULL,
	[Url] [varchar](260) NOT NULL,
	[SiteCollectionID] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_SLAM_Site] PRIMARY KEY CLUSTERED 
(
	[SiteID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Comment](
	[CommentID] [int] IDENTITY(1,1) NOT NULL,
	[PrimaryContentItemId] [varchar](25) NOT NULL,
	[CreatedDate] [datetime] NOT NULL,
	[ModifiedDate] [datetime] NOT NULL,
	[UserId] [int] NULL,
	[Name] [varchar](255) NULL,
	[Email] [varchar](255) NULL,
	[Text] [varchar](max) NULL,
	[CommentStatusID] [varchar](25) NOT NULL,
 CONSTRAINT [PK_Comment] PRIMARY KEY CLUSTERED 
(
	[CommentID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[BrokenLinkTrack](
	[BrokenLinkTrackId] [int] IDENTITY(1,1) NOT NULL,
	[BrokenLinkId] [int] NOT NULL,
	[Date] [datetime] NOT NULL,
	[UserName] [varchar](255) NULL,
 CONSTRAINT [PK_BrokenLinkTrack] PRIMARY KEY CLUSTERED 
(
	[BrokenLinkTrackId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [SLAM].[List](
	[ListID] [uniqueidentifier] NOT NULL,
	[DefaultViewUrl] [varchar](260) NOT NULL,
	[NewFormUrl] [varchar](260) NOT NULL,
	[EditFormUrl] [varchar](260) NOT NULL,
	[DisplayFormUrl] [varchar](260) NOT NULL,
	[SiteID] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_SLAM_List] PRIMARY KEY CLUSTERED 
(
	[ListID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[GroupSite](
	[GroupID] [int] NOT NULL,
	[SiteID] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_GroupSite] PRIMARY KEY CLUSTERED 
(
	[GroupID] ASC,
	[SiteID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[SiteOrListDefault](
	[SiteOrListDefaultID] [varchar](25) NOT NULL,
	[ListID] [uniqueidentifier] NOT NULL,
	[Title] [varchar](255) NOT NULL,
	[SiteListUrl] [varchar](255) NOT NULL,
 CONSTRAINT [PK_SiteOrListDefault] PRIMARY KEY CLUSTERED 
(
	[SiteOrListDefaultID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ContentType](
	[ContentTypeID] [varchar](25) NOT NULL,
	[ListID] [uniqueidentifier] NOT NULL,
	[Title] [varchar](255) NOT NULL,
	[DefaultIcon] [varchar](255) NOT NULL,
	[MatchExtension] [varchar](255) NULL,
 CONSTRAINT [PK_ContentType] PRIMARY KEY CLUSTERED 
(
	[ContentTypeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Icon](
	[IconID] [varchar](25) NOT NULL,
	[ListID] [uniqueidentifier] NOT NULL,
	[Name] [varchar](255) NOT NULL,
	[Extension] [varchar](255) NOT NULL,
	[Icon] [varchar](255) NOT NULL,
 CONSTRAINT [PK_Icon] PRIMARY KEY CLUSTERED 
(
	[IconID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[FeatureLocation](
	[FeatureLocationID] [varchar](25) NOT NULL,
	[ListID] [uniqueidentifier] NOT NULL,
	[Title] [varchar](255) NOT NULL,
 CONSTRAINT [PK_FeatureLocation] PRIMARY KEY CLUSTERED 
(
	[FeatureLocationID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TagCategory](
	[TagCategoryID] [varchar](25) NOT NULL,
	[ListItemID] [uniqueidentifier] NOT NULL,
	[ListID] [uniqueidentifier] NOT NULL,
	[ListRelativeID] [int] NOT NULL,
	[Title] [varchar](255) NOT NULL,
	[ListLocation] [varchar](255) NULL,
	[TagBrowser] [varchar](255) NOT NULL,
	[DisplayOrder] [int] NOT NULL,
	[Featurable] [varchar](255) NULL,
	[IsRelatable] [bit] NOT NULL,
 CONSTRAINT [PK_TagCategory] PRIMARY KEY CLUSTERED 
(
	[TagCategoryID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Tag](
	[TagID] [varchar](25) NOT NULL,
	[ListItemID] [uniqueidentifier] NOT NULL,
	[ListID] [uniqueidentifier] NOT NULL,
	[ListRelativeID] [int] NOT NULL,
	[Identifier] [varchar](255) NOT NULL,
	[DisplayName] [varchar](255) NULL,
	[RestrictAccess] [bit] NULL,
	[Featured] [bit] NULL,
	[Description] [varchar](max) NULL,
	[PageContent] [varchar](max) NULL,
	[CreatedDate] [datetime] NOT NULL,
	[ModifiedDate] [datetime] NOT NULL,
	[HideInTagMenu] [bit] NULL,
 CONSTRAINT [PK_Tag] PRIMARY KEY CLUSTERED 
(
	[TagID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TagTree](
	[TagTreeID] [varchar](25) NOT NULL,
	[ListID] [uniqueidentifier] NOT NULL,
	[Title] [varchar](255) NOT NULL,
	[SortOrder] [int] NOT NULL,
 CONSTRAINT [PK_TagTree] PRIMARY KEY CLUSTERED 
(
	[TagTreeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TagTagTree](
	[TagID] [varchar](25) NOT NULL,
	[TagTreeID] [varchar](25) NOT NULL,
 CONSTRAINT [PK_TagTagTree] PRIMARY KEY CLUSTERED 
(
	[TagID] ASC,
	[TagTreeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TagScope](
	[TagID] [varchar](25) NOT NULL,
	[ContentTypeID] [varchar](25) NOT NULL,
 CONSTRAINT [PK_TagScope] PRIMARY KEY CLUSTERED 
(
	[TagID] ASC,
	[ContentTypeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TagOwner](
	[TagID] [varchar](25) NOT NULL,
	[UserID] [int] NOT NULL,
 CONSTRAINT [PK_TagOwner] PRIMARY KEY CLUSTERED 
(
	[TagID] ASC,
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TagHierarchyPosition](
	[PositionID] [int] IDENTITY(1,1) NOT NULL,
	[ParentPositionID] [int] NULL,
	[TagID] [varchar](25) NOT NULL,
	[TagCategoryID] [varchar](25) NOT NULL,
	[SortOrder] [int] NOT NULL,
	[TagTreeID] [varchar](25) NOT NULL,
 CONSTRAINT [PK_TagHierarchyPosition] PRIMARY KEY CLUSTERED 
(
	[PositionID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TagCulture](
	[TagID] [varchar](25) NOT NULL,
	[Culture] [varchar](10) NOT NULL,
	[DisplayName] [varchar](255) NULL,
	[Description] [varchar](max) NULL,
	[PageContent] [varchar](max) NULL,
	[Synonyms] [varchar](max) NULL,
	[ModifiedDate] [datetime] NOT NULL,
 CONSTRAINT [PK_TagCulture] PRIMARY KEY CLUSTERED 
(
	[TagID] ASC,
	[Culture] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[FeatureLocationScope](
	[FeatureLocationID] [varchar](25) NOT NULL,
	[ContentTypeID] [varchar](25) NOT NULL,
 CONSTRAINT [PK_FeatureLocationScope] PRIMARY KEY CLUSTERED 
(
	[FeatureLocationID] ASC,
	[ContentTypeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[DefaultTag](
	[SiteOrListDefaultID] [varchar](25) NOT NULL,
	[TagID] [varchar](25) NOT NULL,
 CONSTRAINT [PK_DefaultTag] PRIMARY KEY CLUSTERED 
(
	[SiteOrListDefaultID] ASC,
	[TagID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ContentTypeTag](
	[ContentTypeID] [varchar](25) NOT NULL,
	[TagID] [varchar](25) NOT NULL,
 CONSTRAINT [PK_ContentTypeTag] PRIMARY KEY CLUSTERED 
(
	[ContentTypeID] ASC,
	[TagID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ContentItem](
	[ContentItemID] [varchar](25) NOT NULL,
	[PrimaryContentItemID] [varchar](25) NOT NULL,
	[ListItemID] [uniqueidentifier] NOT NULL,
	[ListID] [uniqueidentifier] NOT NULL,
	[ListRelativeID] [int] NOT NULL,
	[ContentTypeID] [varchar](25) NOT NULL,
	[FrontEndUrl] [varchar](255) NOT NULL,
	[StatusID] [int] NOT NULL,
	[CreatedByUserID] [int] NOT NULL,
	[ModifiedByUserID] [int] NOT NULL,
	[CreatedDate] [datetime] NOT NULL,
	[ModifiedDate] [datetime] NOT NULL,
	[ReferenceTitle] [varchar](255) NOT NULL,
	[Slug] [varchar](255) NOT NULL,
	[Rating] [int] NULL,
	[FeatureScore] [int] NULL,
	[ExpirationDate] [datetime] NULL,
	[VerifiedDate] [datetime] NULL,
	[VerifiedByUserID] [int] NULL,
 CONSTRAINT [PK_ContentItem] PRIMARY KEY CLUSTERED 
(
	[ContentItemID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Zone](
	[ZoneID] [varchar](25) NOT NULL,
	[ListID] [uniqueidentifier] NOT NULL,
	[Title] [varchar](255) NOT NULL,
	[Icon] [varchar](255) NULL,
	[TagTreeID] [varchar](25) NOT NULL,
 CONSTRAINT [PK_Zone] PRIMARY KEY CLUSTERED 
(
	[ZoneID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ZoneSite](
	[ZoneID] [varchar](25) NOT NULL,
	[SiteID] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_ZoneSite] PRIMARY KEY CLUSTERED 
(
	[ZoneID] ASC,
	[SiteID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ContentItemTag](
	[ContentItemID] [varchar](25) NOT NULL,
	[TagID] [varchar](25) NOT NULL,
 CONSTRAINT [PK_ContentItemTag] PRIMARY KEY CLUSTERED 
(
	[ContentItemID] ASC,
	[TagID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ContentItemFeatureOnTag](
	[ContentItemID] [varchar](25) NOT NULL,
	[TagID] [varchar](25) NOT NULL,
	[FeatureLevel] [int] NOT NULL,
 CONSTRAINT [PK_ContentItemFeatureOnTag] PRIMARY KEY CLUSTERED 
(
	[ContentItemID] ASC,
	[TagID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ContentItemFeatureLocation](
	[ContentItemID] [varchar](25) NOT NULL,
	[FeatureLocationID] [varchar](25) NOT NULL,
	[FeatureLevel] [int] NOT NULL,
 CONSTRAINT [PK_ContentItemFeatureLocation] PRIMARY KEY CLUSTERED 
(
	[ContentItemID] ASC,
	[FeatureLocationID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[BrokenLink] ADD  CONSTRAINT [DF_BrokenLink_IsHandled]  DEFAULT ((0)) FOR [IsHandled]
GO
ALTER TABLE [dbo].[BrokenLink] ADD  CONSTRAINT [DF_BrokenLink_IgnoreOneTime]  DEFAULT ((0)) FOR [IgnoreOneTime]
GO
ALTER TABLE [dbo].[Group] ADD  CONSTRAINT [DF_Group_View]  DEFAULT ((1)) FOR [View]
GO
ALTER TABLE [dbo].[Group] ADD  CONSTRAINT [DF_Group_Add]  DEFAULT ((1)) FOR [Add]
GO
ALTER TABLE [dbo].[Group] ADD  CONSTRAINT [DF_Group_Edit]  DEFAULT ((1)) FOR [Edit]
GO
ALTER TABLE [dbo].[Group] ADD  CONSTRAINT [DF_Group_Approve]  DEFAULT ((1)) FOR [Approve]
GO
ALTER TABLE [dbo].[Group] ADD  CONSTRAINT [DF_Group_Delete]  DEFAULT ((1)) FOR [Delete]
GO
ALTER TABLE [dbo].[TagHierarchyPosition] ADD  CONSTRAINT [DF_TagHierarchyPosition_TagTreeID]  DEFAULT ('kc') FOR [TagTreeID]
GO
ALTER TABLE [dbo].[BrokenLinkTrack]  WITH CHECK ADD  CONSTRAINT [FK_BrokenLinkTrack_BrokenLink] FOREIGN KEY([BrokenLinkId])
REFERENCES [dbo].[BrokenLink] ([BrokenLinkId])
GO
ALTER TABLE [dbo].[BrokenLinkTrack] CHECK CONSTRAINT [FK_BrokenLinkTrack_BrokenLink]
GO
ALTER TABLE [dbo].[Comment]  WITH CHECK ADD  CONSTRAINT [FK_Comment_CommentStatus] FOREIGN KEY([CommentStatusID])
REFERENCES [dbo].[CommentStatus] ([CommentStatusID])
GO
ALTER TABLE [dbo].[Comment] CHECK CONSTRAINT [FK_Comment_CommentStatus]
GO
ALTER TABLE [dbo].[ContentItem]  WITH CHECK ADD  CONSTRAINT [FK_ContentItem_ContentType0] FOREIGN KEY([ContentTypeID])
REFERENCES [dbo].[ContentType] ([ContentTypeID])
GO
ALTER TABLE [dbo].[ContentItem] CHECK CONSTRAINT [FK_ContentItem_ContentType0]
GO
ALTER TABLE [dbo].[ContentItem]  WITH CHECK ADD  CONSTRAINT [FK_ContentItem_List] FOREIGN KEY([ListID])
REFERENCES [SLAM].[List] ([ListID])
GO
ALTER TABLE [dbo].[ContentItem] CHECK CONSTRAINT [FK_ContentItem_List]
GO
ALTER TABLE [dbo].[ContentItem]  WITH CHECK ADD  CONSTRAINT [FK_ContentItem_Status1] FOREIGN KEY([StatusID])
REFERENCES [dbo].[Status] ([StatusID])
GO
ALTER TABLE [dbo].[ContentItem] CHECK CONSTRAINT [FK_ContentItem_Status1]
GO
ALTER TABLE [dbo].[ContentItem]  WITH CHECK ADD  CONSTRAINT [FK_ContentItem_User2] FOREIGN KEY([CreatedByUserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[ContentItem] CHECK CONSTRAINT [FK_ContentItem_User2]
GO
ALTER TABLE [dbo].[ContentItem]  WITH CHECK ADD  CONSTRAINT [FK_ContentItem_User3] FOREIGN KEY([ModifiedByUserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[ContentItem] CHECK CONSTRAINT [FK_ContentItem_User3]
GO
ALTER TABLE [dbo].[ContentItemFeatureLocation]  WITH CHECK ADD  CONSTRAINT [FK_ContentItemFeatureLocation_ContentItem] FOREIGN KEY([ContentItemID])
REFERENCES [dbo].[ContentItem] ([ContentItemID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ContentItemFeatureLocation] CHECK CONSTRAINT [FK_ContentItemFeatureLocation_ContentItem]
GO
ALTER TABLE [dbo].[ContentItemFeatureLocation]  WITH CHECK ADD  CONSTRAINT [FK_ContentItemFeatureLocation_FeatureLocation] FOREIGN KEY([FeatureLocationID])
REFERENCES [dbo].[FeatureLocation] ([FeatureLocationID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ContentItemFeatureLocation] CHECK CONSTRAINT [FK_ContentItemFeatureLocation_FeatureLocation]
GO
ALTER TABLE [dbo].[ContentItemFeatureOnTag]  WITH CHECK ADD  CONSTRAINT [FK_ContentItemFeatureOnTag_ContentItem] FOREIGN KEY([ContentItemID])
REFERENCES [dbo].[ContentItem] ([ContentItemID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ContentItemFeatureOnTag] CHECK CONSTRAINT [FK_ContentItemFeatureOnTag_ContentItem]
GO
ALTER TABLE [dbo].[ContentItemFeatureOnTag]  WITH CHECK ADD  CONSTRAINT [FK_ContentItemFeatureOnTag_Tag] FOREIGN KEY([TagID])
REFERENCES [dbo].[Tag] ([TagID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ContentItemFeatureOnTag] CHECK CONSTRAINT [FK_ContentItemFeatureOnTag_Tag]
GO
ALTER TABLE [dbo].[ContentItemTag]  WITH CHECK ADD  CONSTRAINT [FK_ContentItemTag_ContentItem] FOREIGN KEY([ContentItemID])
REFERENCES [dbo].[ContentItem] ([ContentItemID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ContentItemTag] CHECK CONSTRAINT [FK_ContentItemTag_ContentItem]
GO
ALTER TABLE [dbo].[ContentItemTag]  WITH CHECK ADD  CONSTRAINT [FK_ContentItemTag_Tag] FOREIGN KEY([TagID])
REFERENCES [dbo].[Tag] ([TagID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ContentItemTag] CHECK CONSTRAINT [FK_ContentItemTag_Tag]
GO
ALTER TABLE [dbo].[ContentType]  WITH CHECK ADD  CONSTRAINT [FK_ContentType_List] FOREIGN KEY([ListID])
REFERENCES [SLAM].[List] ([ListID])
GO
ALTER TABLE [dbo].[ContentType] CHECK CONSTRAINT [FK_ContentType_List]
GO
ALTER TABLE [dbo].[ContentTypeTag]  WITH CHECK ADD  CONSTRAINT [FK_ContentTypeTag_ContentType] FOREIGN KEY([ContentTypeID])
REFERENCES [dbo].[ContentType] ([ContentTypeID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ContentTypeTag] CHECK CONSTRAINT [FK_ContentTypeTag_ContentType]
GO
ALTER TABLE [dbo].[DefaultTag]  WITH CHECK ADD  CONSTRAINT [FK_DefaultTag_SiteOrListDefault] FOREIGN KEY([SiteOrListDefaultID])
REFERENCES [dbo].[SiteOrListDefault] ([SiteOrListDefaultID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[DefaultTag] CHECK CONSTRAINT [FK_DefaultTag_SiteOrListDefault]
GO
ALTER TABLE [dbo].[DefaultTag]  WITH CHECK ADD  CONSTRAINT [FK_DefaultTag_Tag] FOREIGN KEY([TagID])
REFERENCES [dbo].[Tag] ([TagID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[DefaultTag] CHECK CONSTRAINT [FK_DefaultTag_Tag]
GO
ALTER TABLE [dbo].[FeatureLocation]  WITH CHECK ADD  CONSTRAINT [FK_FeatureLocation_List] FOREIGN KEY([ListID])
REFERENCES [SLAM].[List] ([ListID])
GO
ALTER TABLE [dbo].[FeatureLocation] CHECK CONSTRAINT [FK_FeatureLocation_List]
GO
ALTER TABLE [dbo].[FeatureLocationScope]  WITH CHECK ADD  CONSTRAINT [FK_FeatureLocationScope_ContentType] FOREIGN KEY([ContentTypeID])
REFERENCES [dbo].[ContentType] ([ContentTypeID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[FeatureLocationScope] CHECK CONSTRAINT [FK_FeatureLocationScope_ContentType]
GO
ALTER TABLE [dbo].[FeatureLocationScope]  WITH CHECK ADD  CONSTRAINT [FK_FeatureLocationScope_FeatureLocation] FOREIGN KEY([FeatureLocationID])
REFERENCES [dbo].[FeatureLocation] ([FeatureLocationID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[FeatureLocationScope] CHECK CONSTRAINT [FK_FeatureLocationScope_FeatureLocation]
GO
ALTER TABLE [dbo].[GroupSite]  WITH CHECK ADD  CONSTRAINT [FK_GroupSite_Group] FOREIGN KEY([GroupID])
REFERENCES [dbo].[Group] ([GroupID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[GroupSite] CHECK CONSTRAINT [FK_GroupSite_Group]
GO
ALTER TABLE [dbo].[GroupSite]  WITH CHECK ADD  CONSTRAINT [FK_GroupSite_Site] FOREIGN KEY([SiteID])
REFERENCES [SLAM].[Site] ([SiteID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[GroupSite] CHECK CONSTRAINT [FK_GroupSite_Site]
GO
ALTER TABLE [dbo].[Icon]  WITH CHECK ADD  CONSTRAINT [FK_Icon_List] FOREIGN KEY([ListID])
REFERENCES [SLAM].[List] ([ListID])
GO
ALTER TABLE [dbo].[Icon] CHECK CONSTRAINT [FK_Icon_List]
GO
ALTER TABLE [dbo].[SiteOrListDefault]  WITH CHECK ADD  CONSTRAINT [FK_SiteOrListDefault_List] FOREIGN KEY([ListID])
REFERENCES [SLAM].[List] ([ListID])
GO
ALTER TABLE [dbo].[SiteOrListDefault] CHECK CONSTRAINT [FK_SiteOrListDefault_List]
GO
ALTER TABLE [dbo].[Tag]  WITH CHECK ADD  CONSTRAINT [FK_Tag_List] FOREIGN KEY([ListID])
REFERENCES [SLAM].[List] ([ListID])
GO
ALTER TABLE [dbo].[Tag] CHECK CONSTRAINT [FK_Tag_List]
GO
ALTER TABLE [dbo].[TagCategory]  WITH CHECK ADD  CONSTRAINT [FK_TagCategory_List] FOREIGN KEY([ListID])
REFERENCES [SLAM].[List] ([ListID])
GO
ALTER TABLE [dbo].[TagCategory] CHECK CONSTRAINT [FK_TagCategory_List]
GO
ALTER TABLE [dbo].[TagCulture]  WITH CHECK ADD  CONSTRAINT [FK_TagCulture_TagCulture] FOREIGN KEY([TagID])
REFERENCES [dbo].[Tag] ([TagID])
GO
ALTER TABLE [dbo].[TagCulture] CHECK CONSTRAINT [FK_TagCulture_TagCulture]
GO
ALTER TABLE [dbo].[TagHierarchyPosition]  WITH CHECK ADD  CONSTRAINT [FK_TagHierarchyPosition_Tag] FOREIGN KEY([TagID])
REFERENCES [dbo].[Tag] ([TagID])
GO
ALTER TABLE [dbo].[TagHierarchyPosition] CHECK CONSTRAINT [FK_TagHierarchyPosition_Tag]
GO
ALTER TABLE [dbo].[TagHierarchyPosition]  WITH CHECK ADD  CONSTRAINT [FK_TagHierarchyPosition_TagCategory] FOREIGN KEY([TagCategoryID])
REFERENCES [dbo].[TagCategory] ([TagCategoryID])
GO
ALTER TABLE [dbo].[TagHierarchyPosition] CHECK CONSTRAINT [FK_TagHierarchyPosition_TagCategory]
GO
ALTER TABLE [dbo].[TagHierarchyPosition]  WITH CHECK ADD  CONSTRAINT [FK_TagHierarchyPosition_TagTree] FOREIGN KEY([TagTreeID])
REFERENCES [dbo].[TagTree] ([TagTreeID])
GO
ALTER TABLE [dbo].[TagHierarchyPosition] CHECK CONSTRAINT [FK_TagHierarchyPosition_TagTree]
GO
ALTER TABLE [dbo].[TagOwner]  WITH CHECK ADD  CONSTRAINT [FK_TagOwner_Tag] FOREIGN KEY([TagID])
REFERENCES [dbo].[Tag] ([TagID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[TagOwner] CHECK CONSTRAINT [FK_TagOwner_Tag]
GO
ALTER TABLE [dbo].[TagOwner]  WITH CHECK ADD  CONSTRAINT [FK_TagOwner_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[TagOwner] CHECK CONSTRAINT [FK_TagOwner_User]
GO
ALTER TABLE [dbo].[TagScope]  WITH CHECK ADD  CONSTRAINT [FK_TagScope_ContentType] FOREIGN KEY([ContentTypeID])
REFERENCES [dbo].[ContentType] ([ContentTypeID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[TagScope] CHECK CONSTRAINT [FK_TagScope_ContentType]
GO
ALTER TABLE [dbo].[TagScope]  WITH CHECK ADD  CONSTRAINT [FK_TagScope_Tag] FOREIGN KEY([TagID])
REFERENCES [dbo].[Tag] ([TagID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[TagScope] CHECK CONSTRAINT [FK_TagScope_Tag]
GO
ALTER TABLE [dbo].[TagTagTree]  WITH CHECK ADD  CONSTRAINT [FK_TagTagTree_Tag] FOREIGN KEY([TagID])
REFERENCES [dbo].[Tag] ([TagID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[TagTagTree] CHECK CONSTRAINT [FK_TagTagTree_Tag]
GO
ALTER TABLE [dbo].[TagTagTree]  WITH CHECK ADD  CONSTRAINT [FK_TagTagTree_TagTree] FOREIGN KEY([TagTreeID])
REFERENCES [dbo].[TagTree] ([TagTreeID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[TagTagTree] CHECK CONSTRAINT [FK_TagTagTree_TagTree]
GO
ALTER TABLE [dbo].[TagTree]  WITH CHECK ADD  CONSTRAINT [FK_TagTree_List] FOREIGN KEY([ListID])
REFERENCES [SLAM].[List] ([ListID])
GO
ALTER TABLE [dbo].[TagTree] CHECK CONSTRAINT [FK_TagTree_List]
GO
ALTER TABLE [dbo].[UserGroup]  WITH CHECK ADD  CONSTRAINT [FK_UserGroup_Group] FOREIGN KEY([GroupID])
REFERENCES [dbo].[Group] ([GroupID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[UserGroup] CHECK CONSTRAINT [FK_UserGroup_Group]
GO
ALTER TABLE [dbo].[UserGroup]  WITH CHECK ADD  CONSTRAINT [FK_UserGroup_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[UserGroup] CHECK CONSTRAINT [FK_UserGroup_User]
GO
ALTER TABLE [dbo].[Zone]  WITH CHECK ADD  CONSTRAINT [FK_Zone_List] FOREIGN KEY([ListID])
REFERENCES [SLAM].[List] ([ListID])
GO
ALTER TABLE [dbo].[Zone] CHECK CONSTRAINT [FK_Zone_List]
GO
ALTER TABLE [dbo].[Zone]  WITH CHECK ADD  CONSTRAINT [FK_Zone_TagTree] FOREIGN KEY([TagTreeID])
REFERENCES [dbo].[TagTree] ([TagTreeID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Zone] CHECK CONSTRAINT [FK_Zone_TagTree]
GO
ALTER TABLE [dbo].[ZoneSite]  WITH CHECK ADD  CONSTRAINT [FK_ZoneSite_Site] FOREIGN KEY([SiteID])
REFERENCES [SLAM].[Site] ([SiteID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ZoneSite] CHECK CONSTRAINT [FK_ZoneSite_Site]
GO
ALTER TABLE [dbo].[ZoneSite]  WITH CHECK ADD  CONSTRAINT [FK_ZoneSite_Zone] FOREIGN KEY([ZoneID])
REFERENCES [dbo].[Zone] ([ZoneID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ZoneSite] CHECK CONSTRAINT [FK_ZoneSite_Zone]
GO
ALTER TABLE [SLAM].[List]  WITH CHECK ADD  CONSTRAINT [FK_List_Site] FOREIGN KEY([SiteID])
REFERENCES [SLAM].[Site] ([SiteID])
ON DELETE CASCADE
GO
ALTER TABLE [SLAM].[List] CHECK CONSTRAINT [FK_List_Site]
GO
ALTER TABLE [SLAM].[Site]  WITH CHECK ADD  CONSTRAINT [FK_Site_SiteCollection] FOREIGN KEY([SiteCollectionID])
REFERENCES [SLAM].[SiteCollection] ([SiteCollectionID])
ON DELETE CASCADE
GO
ALTER TABLE [SLAM].[Site] CHECK CONSTRAINT [FK_Site_SiteCollection]
GO
INSERT INTO [dbo].[Status] ([StatusID],[Name]) VALUES (1, 'New')
INSERT INTO [dbo].[Status] ([StatusID],[Name]) VALUES (2, 'Pending Approval (New)')
INSERT INTO [dbo].[Status] ([StatusID],[Name]) VALUES (3, 'Live')
INSERT INTO [dbo].[Status] ([StatusID],[Name]) VALUES (4, 'Modified')
INSERT INTO [dbo].[Status] ([StatusID],[Name]) VALUES (5, 'Pending Approval (Modified)')
INSERT INTO [dbo].[Status] ([StatusID],[Name]) VALUES (6, 'Retired')
GO